import { Button } from 'antd';
import { observable, observe } from 'mobx';
import { inject, observer } from 'mobx-react';
import React, { Component } from 'react';

import UserStore from '../../store/UserStore'
import { AdminStore } from '../../store/AdminStore'

interface IProps{
    userStore?:UserStore
    adminStore?:AdminStore
}
@inject('userStore','adminStore')
@observer

class UserDetail extends Component<IProps> {
 
    changeName =()=>{
        this.props.adminStore?.changeName('Lee')
    }
    render() {
        return (
            <>
                {this.props.adminStore?.admin.name}
                <Button type="primary" onClick={this.changeName}>修改姓名</Button>
            </>
        );
    }
}

export default UserDetail;